<!--
 * @FilePath     : /study_code/layui/13-4-2.html
 * @Description  : table.reloadData()
 * @Date         : 2025-04-07 17:14:26
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-08 15:33:41
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <button id="btn1">按钮1：表格完全重载</button>
    <hr />
    <table id="demo" lay-filter="test"></table>

    <script src="/layui/dist/layui.js"></script>
    <script src="/layui/table/common.js"></script>
    <script>
      var table = layui.table,
        $ = layui.$

      table.render({
        elem: '#demo',
        cols: cols,
        data: tableData,
        id: 'fygtest',
      })

      $('#btn1').on('click', function () {
        table.reloadData('fygtest', {
          where: {},
          data: tableDataTwo,
          height: 500,
        })
      })
    </script>
  </body>
</html>
